#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    vector<int> sumEvenAfterQueries(vector<int>& nums, vector<vector<int>>& qs) {
        int m = qs.size(), t = 0;
        std::vector<int> ans(m);
        for (int x : nums) t += x % 2 == 0 ? x : 0;
        for (int i = 0; i < m; i++) {
            int val = qs[i][0], idx = qs[i][1];
            if (nums[idx] % 2 == 0) t -= nums[idx];
            nums[idx] += val;
            if (nums[idx] % 2 == 0) t += nums[idx];
            ans[i] = t;
        }
        return ans;
    }
};
int main()
{
	return 0;
}